import Common from './common.js'

class News extends Common {
  constructor(url) {
    super()
    this.apiUrl = this.apiUrl + url
  }
  detail(id) {
    return this.http_get(this.apiUrl + '/detail', { id: id })
  }
  focusNum(params) {
    return this.http_get(this.apiUrl + '/joinedmemberlist', params)
  }
  commentlist (params) {
    return this.http_get(this.apiUrl + '/commentlist', params)
  }
  commentlistTwo(params) {//获取二级评论
    return this.http_get(this.apiUrl + '/commentlistTwo', params )
  }
  postcomment (params) {
    return this.http_post(this.apiUrl + '/postcomment', params)
  }
  deletecomment (id) { // id  评论的id
    return this.http_post(this.apiUrl + '/deletecomment', {id: id})
  }
  replycomment (params) {
    return this.http_post(this.apiUrl + '/replycomment', params)
  }
  upNews (id) { // 点赞新闻
    return this.http_post(this.apiUrl + '/upnews', { newsId: id })
  }
  cancelUpNews (id) { // 取消点赞评论
    return this.http_post(this.apiUrl + '/cancelupnews', { newsId: id })
  }
  upComment (id) { // 点赞评论
    return this.http_post(this.apiUrl + '/upcomment', { id: id })
  }
  cancelUpComment (id) { // 取消点赞评论
    return this.http_post(this.apiUrl + '/cancelupcomment', { id: id })
  }
  applyactivity (id) { // 参加活动 id 活动的id
    return this.http_post(this.apiUrl + '/applyactivity', {id: id})
  }
  adminReleaseNews (data) { // 发布新闻
    return this.http_post(this.apiUrl + '/admin/releaseNews', data)
  }
  approvalstatus(){//获取评论、活动、新闻是否审核状态
    return this.http_get(this.apiUrl +'/approvalstatus')
  }
  deletecomment(accId, commentId,newId){//删除评论
    return this.http_post(this.apiUrl + '/deletecomment', { accId:accId, commentId:commentId,newId})
  }
}
export default News